export function fontSize (res){
    const clientWidth = window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;
    if (!clientWidth) return;
    let fontSize = clientWidth / 1920;
    return res*fontSize;
}

export function tranNumber(value, n) {

    var param = {};
    var k = 10000,
        sizes = ['', '万', '亿', '万亿'],
        i;
    if(value < k){
        param.value =value
        param.unit=''
    }else{
        i = Math.floor(Math.log(value) / Math.log(k));

        param.value = ((value / Math.pow(k, i))).toFixed(n);
        param.unit = sizes[i];
    }
    return param;
}
